package com.nisco.ampf;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.animation.AlphaAnimation;
import android.view.animation.AnimationSet;
import android.widget.ImageView;

public class AMPFActivity extends Activity {
	private ImageView welcomImgView;
	private Thread welThread;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.welcome);
        
       
//		Intent intent = new Intent(AMPFActivity.this, LoginActivity.class);
//		startActivity(intent);
		
		welThread = new Thread(){

			@Override
			public void run() {
				super.run();
				synchronized (this) {
					try {
						 //开机动画
				        welcomImgView = (ImageView)findViewById(R.id.welcomeImgView);
				        AnimationSet animationSet = new AnimationSet(true);
				        AlphaAnimation alphaAnimation = new AlphaAnimation(1, 0);
						animationSet.addAnimation(alphaAnimation);
						animationSet.setDuration(3050);
						animationSet.setFillAfter(true);
						welcomImgView.startAnimation(animationSet);
						wait(3000);
						Intent intent = new Intent(AMPFActivity.this, LoginActivity.class);
						startActivity(intent);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					finally{
						finish();
						
					}
				}
			}
		};
		welThread.start();
    }
}